<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>SoupLogger</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="libsoup Reference Manual">
<link rel="up" href="ch03.html" title="Additional Features">
<link rel="prev" href="SoupCookieJarText.html" title="SoupCookieJarText">
<link rel="next" href="SoupProxyURIResolver.html" title="SoupProxyURIResolver">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="SoupCookieJarText.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch03.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">libsoup Reference Manual</th>
<td><a accesskey="n" href="SoupProxyURIResolver.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#SoupLogger.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#SoupLogger.description" class="shortcut">Description</a>
                   | 
                  <a href="#SoupLogger.object-hierarchy" class="shortcut">Object Hierarchy</a>
                   | 
                  <a href="#SoupLogger.implemented-interfaces" class="shortcut">Implemented Interfaces</a>
</td></tr>
</table>
<div class="refentry">
<a name="SoupLogger"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="SoupLogger.top_of_page"></a>SoupLogger</span></h2>
<p>SoupLogger — Debug logging support</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="SoupLogger.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;libsoup/soup.h&gt;

                    <a class="link" href="SoupLogger.html#SoupLogger-struct" title="SoupLogger">SoupLogger</a>;
enum                <a class="link" href="SoupLogger.html#SoupLoggerLogLevel" title="enum SoupLoggerLogLevel">SoupLoggerLogLevel</a>;
<a class="link" href="SoupLogger.html" title="SoupLogger"><span class="returnvalue">SoupLogger</span></a> *        <a class="link" href="SoupLogger.html#soup-logger-new" title="soup_logger_new ()">soup_logger_new</a>                     (<em class="parameter"><code><a class="link" href="SoupLogger.html#SoupLoggerLogLevel" title="enum SoupLoggerLogLevel"><span class="type">SoupLoggerLogLevel</span></a> level</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> max_body_size</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="SoupLogger.html#soup-logger-attach" title="soup_logger_attach ()">soup_logger_attach</a>                  (<em class="parameter"><code><a class="link" href="SoupLogger.html" title="SoupLogger"><span class="type">SoupLogger</span></a> *logger</code></em>,
                                                         <em class="parameter"><code><a class="link" href="SoupSession.html" title="SoupSession"><span class="type">SoupSession</span></a> *session</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="SoupLogger.html#soup-logger-detach" title="soup_logger_detach ()">soup_logger_detach</a>                  (<em class="parameter"><code><a class="link" href="SoupLogger.html" title="SoupLogger"><span class="type">SoupLogger</span></a> *logger</code></em>,
                                                         <em class="parameter"><code><a class="link" href="SoupSession.html" title="SoupSession"><span class="type">SoupSession</span></a> *session</code></em>);

<a class="link" href="SoupLogger.html#SoupLoggerLogLevel" title="enum SoupLoggerLogLevel"><span class="returnvalue">SoupLoggerLogLevel</span></a>  (<a class="link" href="SoupLogger.html#SoupLoggerFilter" title="SoupLoggerFilter ()">*SoupLoggerFilter</a>)                 (<em class="parameter"><code><a class="link" href="SoupLogger.html" title="SoupLogger"><span class="type">SoupLogger</span></a> *logger</code></em>,
                                                         <em class="parameter"><code><a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a> *msg</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="SoupLogger.html#soup-logger-set-request-filter" title="soup_logger_set_request_filter ()">soup_logger_set_request_filter</a>      (<em class="parameter"><code><a class="link" href="SoupLogger.html" title="SoupLogger"><span class="type">SoupLogger</span></a> *logger</code></em>,
                                                         <em class="parameter"><code><a class="link" href="SoupLogger.html#SoupLoggerFilter" title="SoupLoggerFilter ()"><span class="type">SoupLoggerFilter</span></a> request_filter</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> filter_data</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> destroy</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="SoupLogger.html#soup-logger-set-response-filter" title="soup_logger_set_response_filter ()">soup_logger_set_response_filter</a>     (<em class="parameter"><code><a class="link" href="SoupLogger.html" title="SoupLogger"><span class="type">SoupLogger</span></a> *logger</code></em>,
                                                         <em class="parameter"><code><a class="link" href="SoupLogger.html#SoupLoggerFilter" title="SoupLoggerFilter ()"><span class="type">SoupLoggerFilter</span></a> response_filter</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> filter_data</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> destroy</code></em>);

<span class="returnvalue">void</span>                (<a class="link" href="SoupLogger.html#SoupLoggerPrinter" title="SoupLoggerPrinter ()">*SoupLoggerPrinter</a>)                (<em class="parameter"><code><a class="link" href="SoupLogger.html" title="SoupLogger"><span class="type">SoupLogger</span></a> *logger</code></em>,
                                                         <em class="parameter"><code><a class="link" href="SoupLogger.html#SoupLoggerLogLevel" title="enum SoupLoggerLogLevel"><span class="type">SoupLoggerLogLevel</span></a> level</code></em>,
                                                         <em class="parameter"><code><span class="type">char</span> direction</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *data</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="SoupLogger.html#soup-logger-set-printer" title="soup_logger_set_printer ()">soup_logger_set_printer</a>             (<em class="parameter"><code><a class="link" href="SoupLogger.html" title="SoupLogger"><span class="type">SoupLogger</span></a> *logger</code></em>,
                                                         <em class="parameter"><code><a class="link" href="SoupLogger.html#SoupLoggerPrinter" title="SoupLoggerPrinter ()"><span class="type">SoupLoggerPrinter</span></a> printer</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> printer_data</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> destroy</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="SoupLogger.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
  <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>
   +----SoupLogger
</pre>
</div>
<div class="refsect1">
<a name="SoupLogger.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
<p>
SoupLogger implements
 <a class="link" href="SoupSessionFeature.html" title="SoupSessionFeature">SoupSessionFeature</a>.</p>
</div>
<div class="refsect1">
<a name="SoupLogger.description"></a><h2>Description</h2>
<p>
<a class="link" href="SoupLogger.html" title="SoupLogger"><span class="type">SoupLogger</span></a> watches a <a class="link" href="SoupSession.html" title="SoupSession"><span class="type">SoupSession</span></a> and logs the HTTP traffic that
it generates, for debugging purposes. Many applications use an
environment variable to determine whether or not to use
<a class="link" href="SoupLogger.html" title="SoupLogger"><span class="type">SoupLogger</span></a>, and to determine the amount of debugging output.
</p>
<p>
To use <a class="link" href="SoupLogger.html" title="SoupLogger"><span class="type">SoupLogger</span></a>, first create a logger with <a class="link" href="SoupLogger.html#soup-logger-new" title="soup_logger_new ()"><code class="function">soup_logger_new()</code></a>,
optionally configure it with <a class="link" href="SoupLogger.html#soup-logger-set-request-filter" title="soup_logger_set_request_filter ()"><code class="function">soup_logger_set_request_filter()</code></a>,
<a class="link" href="SoupLogger.html#soup-logger-set-response-filter" title="soup_logger_set_response_filter ()"><code class="function">soup_logger_set_response_filter()</code></a>, and <a class="link" href="SoupLogger.html#soup-logger-set-printer" title="soup_logger_set_printer ()"><code class="function">soup_logger_set_printer()</code></a>,
and then attach it to a session (or multiple sessions) with
<a class="link" href="SoupSession.html#soup-session-add-feature" title="soup_session_add_feature ()"><code class="function">soup_session_add_feature()</code></a>.
</p>
<p>
By default, the debugging output is sent to
<code class="literal">stdout</code>, and looks something like:
</p>
<p>
</p>
<div class="informalexample"><pre class="screen">
&gt; POST /unauth HTTP/1.1
&gt; Soup-Debug-Timestamp: 1200171744
&gt; Soup-Debug: SoupSessionAsync 1 (0x612190), SoupMessage 1 (0x617000), SoupSocket 1 (0x612220)
&gt; Host: localhost
&gt; Content-Type: text/plain
&gt; Connection: close
&gt; 
&gt; This is a test.
  
&lt; HTTP/1.1 201 Created
&lt; Soup-Debug-Timestamp: 1200171744
&lt; Soup-Debug: SoupMessage 1 (0x617000)
&lt; Date: Sun, 12 Jan 2008 21:02:24 GMT
&lt; Content-Length: 0
</pre></div>
<p>
</p>
<p>
The <code class="literal">Soup-Debug-Timestamp</code> line gives the time (as
a <span class="type">time_t</span>) when the request was sent, or the response fully
received.
</p>
<p>
The <code class="literal">Soup-Debug</code> line gives further debugging
information about the <a class="link" href="SoupSession.html" title="SoupSession"><span class="type">SoupSession</span></a>, <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a>, and <a class="link" href="SoupSocket.html" title="SoupSocket"><span class="type">SoupSocket</span></a>
involved; the hex numbers are the addresses of the objects in
question (which may be useful if you are running in a debugger).
The decimal IDs are simply counters that uniquely identify objects
across the lifetime of the <a class="link" href="SoupLogger.html" title="SoupLogger"><span class="type">SoupLogger</span></a>. In particular, this can be
used to identify when multiple messages are sent across the same
connection.
</p>
<p>
Currently, the request half of the message is logged just before
the first byte of the request gets written to the network (from the
<a class="link" href="SoupSession.html#SoupSession-request-started" title='The "request-started" signal'><span class="type">"request_started"</span></a> signal), which means that if you have
not made the complete request body available at that point, it will
not be logged. The response is logged just after the last byte of
the response body is read from the network (from the
<a class="link" href="SoupMessage.html#SoupMessage-got-body" title='The "got-body" signal'><span class="type">"got_body"</span></a> or <a class="link" href="SoupMessage.html#SoupMessage-got-informational" title='The "got-informational" signal'><span class="type">"got_informational"</span></a> signal),
which means that the <a class="link" href="SoupMessage.html#SoupMessage-got-headers" title='The "got-headers" signal'><span class="type">"got_headers"</span></a> signal, and anything
triggered off it (such as <a class="link" href="SoupSession.html#SoupSession-authenticate" title='The "authenticate" signal'><span class="type">"authenticate"</span></a>) will be
emitted <span class="emphasis"><em>before</em></span> the response headers are
actually logged.
</p>
</div>
<div class="refsect1">
<a name="SoupLogger.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="SoupLogger-struct"></a><h3>SoupLogger</h3>
<pre class="programlisting">typedef struct _SoupLogger SoupLogger;</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="SoupLoggerLogLevel"></a><h3>enum SoupLoggerLogLevel</h3>
<pre class="programlisting">typedef enum {
	SOUP_LOGGER_LOG_NONE,
	SOUP_LOGGER_LOG_MINIMAL,
	SOUP_LOGGER_LOG_HEADERS,
	SOUP_LOGGER_LOG_BODY
} SoupLoggerLogLevel;
</pre>
<p>
Describes the level of logging output to provide.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="SOUP-LOGGER-LOG-NONE:CAPS"></a><span class="term"><code class="literal">SOUP_LOGGER_LOG_NONE</code></span></p></td>
<td>No logging
</td>
</tr>
<tr>
<td><p><a name="SOUP-LOGGER-LOG-MINIMAL:CAPS"></a><span class="term"><code class="literal">SOUP_LOGGER_LOG_MINIMAL</code></span></p></td>
<td>Log the Request-Line or Status-Line and
the Soup-Debug pseudo-headers
</td>
</tr>
<tr>
<td><p><a name="SOUP-LOGGER-LOG-HEADERS:CAPS"></a><span class="term"><code class="literal">SOUP_LOGGER_LOG_HEADERS</code></span></p></td>
<td>Log the full request/response headers
</td>
</tr>
<tr>
<td><p><a name="SOUP-LOGGER-LOG-BODY:CAPS"></a><span class="term"><code class="literal">SOUP_LOGGER_LOG_BODY</code></span></p></td>
<td>Log the full headers and request/response
bodies.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="soup-logger-new"></a><h3>soup_logger_new ()</h3>
<pre class="programlisting"><a class="link" href="SoupLogger.html" title="SoupLogger"><span class="returnvalue">SoupLogger</span></a> *        soup_logger_new                     (<em class="parameter"><code><a class="link" href="SoupLogger.html#SoupLoggerLogLevel" title="enum SoupLoggerLogLevel"><span class="type">SoupLoggerLogLevel</span></a> level</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> max_body_size</code></em>);</pre>
<p>
Creates a new <a class="link" href="SoupLogger.html" title="SoupLogger"><span class="type">SoupLogger</span></a> with the given debug level. If <em class="parameter"><code>level</code></em> is
<a class="link" href="SoupLogger.html#SOUP-LOGGER-LOG-BODY:CAPS"><code class="literal">SOUP_LOGGER_LOG_BODY</code></a>, <em class="parameter"><code>max_body_size</code></em> gives the maximum number of
bytes of the body that will be logged. (-1 means "no limit".)
</p>
<p>
If you need finer control over what message parts are and aren't
logged, use <a class="link" href="SoupLogger.html#soup-logger-set-request-filter" title="soup_logger_set_request_filter ()"><code class="function">soup_logger_set_request_filter()</code></a> and
<a class="link" href="SoupLogger.html#soup-logger-set-response-filter" title="soup_logger_set_response_filter ()"><code class="function">soup_logger_set_response_filter()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>level</code></em> :</span></p></td>
<td>the debug level</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>max_body_size</code></em> :</span></p></td>
<td>the maximum body size to output, or -1</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new <a class="link" href="SoupLogger.html" title="SoupLogger"><span class="type">SoupLogger</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="soup-logger-attach"></a><h3>soup_logger_attach ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                soup_logger_attach                  (<em class="parameter"><code><a class="link" href="SoupLogger.html" title="SoupLogger"><span class="type">SoupLogger</span></a> *logger</code></em>,
                                                         <em class="parameter"><code><a class="link" href="SoupSession.html" title="SoupSession"><span class="type">SoupSession</span></a> *session</code></em>);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">soup_logger_attach</code> is deprecated and should not be used in newly-written code. Use <a class="link" href="SoupSession.html#soup-session-add-feature" title="soup_session_add_feature ()"><code class="function">soup_session_add_feature()</code></a> instead.</p>
</div>
<p>
Sets <em class="parameter"><code>logger</code></em> to watch <em class="parameter"><code>session</code></em> and print debug information for
its messages.
</p>
<p>
(The session will take a reference on <em class="parameter"><code>logger</code></em>, which will be
removed when you call <a class="link" href="SoupLogger.html#soup-logger-detach" title="soup_logger_detach ()"><code class="function">soup_logger_detach()</code></a>, or when the session is
destroyed.)
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>logger</code></em> :</span></p></td>
<td>a <a class="link" href="SoupLogger.html" title="SoupLogger"><span class="type">SoupLogger</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>session</code></em> :</span></p></td>
<td>a <a class="link" href="SoupSession.html" title="SoupSession"><span class="type">SoupSession</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="soup-logger-detach"></a><h3>soup_logger_detach ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                soup_logger_detach                  (<em class="parameter"><code><a class="link" href="SoupLogger.html" title="SoupLogger"><span class="type">SoupLogger</span></a> *logger</code></em>,
                                                         <em class="parameter"><code><a class="link" href="SoupSession.html" title="SoupSession"><span class="type">SoupSession</span></a> *session</code></em>);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">soup_logger_detach</code> is deprecated and should not be used in newly-written code. Use <a class="link" href="SoupSession.html#soup-session-remove-feature" title="soup_session_remove_feature ()"><code class="function">soup_session_remove_feature()</code></a> instead.</p>
</div>
<p>
Stops <em class="parameter"><code>logger</code></em> from watching <em class="parameter"><code>session</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>logger</code></em> :</span></p></td>
<td>a <a class="link" href="SoupLogger.html" title="SoupLogger"><span class="type">SoupLogger</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>session</code></em> :</span></p></td>
<td>a <a class="link" href="SoupSession.html" title="SoupSession"><span class="type">SoupSession</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="SoupLoggerFilter"></a><h3>SoupLoggerFilter ()</h3>
<pre class="programlisting"><a class="link" href="SoupLogger.html#SoupLoggerLogLevel" title="enum SoupLoggerLogLevel"><span class="returnvalue">SoupLoggerLogLevel</span></a>  (*SoupLoggerFilter)                 (<em class="parameter"><code><a class="link" href="SoupLogger.html" title="SoupLogger"><span class="type">SoupLogger</span></a> *logger</code></em>,
                                                         <em class="parameter"><code><a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a> *msg</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
<p>
The prototype for a logging filter. The filter callback will be
invoked for each request or response, and should analyze it and
return a <a class="link" href="SoupLogger.html#SoupLoggerLogLevel" title="enum SoupLoggerLogLevel"><span class="type">SoupLoggerLogLevel</span></a> value indicating how much of the
message to log. Eg, it might choose between <a class="link" href="SoupLogger.html#SOUP-LOGGER-LOG-BODY:CAPS"><code class="literal">SOUP_LOGGER_LOG_BODY</code></a>
and <a class="link" href="SoupLogger.html#SOUP-LOGGER-LOG-HEADERS:CAPS"><code class="literal">SOUP_LOGGER_LOG_HEADERS</code></a> depending on the Content-Type.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>logger</code></em> :</span></p></td>
<td>the <a class="link" href="SoupLogger.html" title="SoupLogger"><span class="type">SoupLogger</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td>
<td>the message being logged</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>the data passed to <a class="link" href="SoupLogger.html#soup-logger-set-request-filter" title="soup_logger_set_request_filter ()"><code class="function">soup_logger_set_request_filter()</code></a>
or <a class="link" href="SoupLogger.html#soup-logger-set-response-filter" title="soup_logger_set_response_filter ()"><code class="function">soup_logger_set_response_filter()</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a <a class="link" href="SoupLogger.html#SoupLoggerLogLevel" title="enum SoupLoggerLogLevel"><span class="type">SoupLoggerLogLevel</span></a> value indicating how much of
the message to log</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="soup-logger-set-request-filter"></a><h3>soup_logger_set_request_filter ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                soup_logger_set_request_filter      (<em class="parameter"><code><a class="link" href="SoupLogger.html" title="SoupLogger"><span class="type">SoupLogger</span></a> *logger</code></em>,
                                                         <em class="parameter"><code><a class="link" href="SoupLogger.html#SoupLoggerFilter" title="SoupLoggerFilter ()"><span class="type">SoupLoggerFilter</span></a> request_filter</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> filter_data</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> destroy</code></em>);</pre>
<p>
Sets up a filter to determine the log level for a given request.
For each HTTP request <em class="parameter"><code>logger</code></em> will invoke <em class="parameter"><code>request_filter</code></em> to
determine how much (if any) of that request to log. (If you do not
set a request filter, <em class="parameter"><code>logger</code></em> will just always log requests at the
level passed to <a class="link" href="SoupLogger.html#soup-logger-new" title="soup_logger_new ()"><code class="function">soup_logger_new()</code></a>.)
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>logger</code></em> :</span></p></td>
<td>a <a class="link" href="SoupLogger.html" title="SoupLogger"><span class="type">SoupLogger</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>request_filter</code></em> :</span></p></td>
<td>the callback for request debugging</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>filter_data</code></em> :</span></p></td>
<td>data to pass to the callback</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>destroy</code></em> :</span></p></td>
<td>a <a href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> to free <em class="parameter"><code>filter_data</code></em>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="soup-logger-set-response-filter"></a><h3>soup_logger_set_response_filter ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                soup_logger_set_response_filter     (<em class="parameter"><code><a class="link" href="SoupLogger.html" title="SoupLogger"><span class="type">SoupLogger</span></a> *logger</code></em>,
                                                         <em class="parameter"><code><a class="link" href="SoupLogger.html#SoupLoggerFilter" title="SoupLoggerFilter ()"><span class="type">SoupLoggerFilter</span></a> response_filter</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> filter_data</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> destroy</code></em>);</pre>
<p>
Sets up a filter to determine the log level for a given response.
For each HTTP response <em class="parameter"><code>logger</code></em> will invoke <em class="parameter"><code>response_filter</code></em> to
determine how much (if any) of that response to log. (If you do not
set a response filter, <em class="parameter"><code>logger</code></em> will just always log responses at
the level passed to <a class="link" href="SoupLogger.html#soup-logger-new" title="soup_logger_new ()"><code class="function">soup_logger_new()</code></a>.)
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>logger</code></em> :</span></p></td>
<td>a <a class="link" href="SoupLogger.html" title="SoupLogger"><span class="type">SoupLogger</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>response_filter</code></em> :</span></p></td>
<td>the callback for response debugging</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>filter_data</code></em> :</span></p></td>
<td>data to pass to the callback</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>destroy</code></em> :</span></p></td>
<td>a <a href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> to free <em class="parameter"><code>filter_data</code></em>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="SoupLoggerPrinter"></a><h3>SoupLoggerPrinter ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                (*SoupLoggerPrinter)                (<em class="parameter"><code><a class="link" href="SoupLogger.html" title="SoupLogger"><span class="type">SoupLogger</span></a> *logger</code></em>,
                                                         <em class="parameter"><code><a class="link" href="SoupLogger.html#SoupLoggerLogLevel" title="enum SoupLoggerLogLevel"><span class="type">SoupLoggerLogLevel</span></a> level</code></em>,
                                                         <em class="parameter"><code><span class="type">char</span> direction</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *data</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
<p>
The prototype for a custom printing callback.
</p>
<p>
<em class="parameter"><code>level</code></em> indicates what kind of information is being printed. Eg, it
will be <a class="link" href="SoupLogger.html#SOUP-LOGGER-LOG-HEADERS:CAPS"><code class="literal">SOUP_LOGGER_LOG_HEADERS</code></a> if <em class="parameter"><code>data</code></em> is header data.
</p>
<p>
<em class="parameter"><code>direction</code></em> is either '&lt;', '&gt;', or ' ', and <em class="parameter"><code>data</code></em> is the single line
to print; the printer is expected to add a terminating newline.
</p>
<p>
To get the effect of the default printer, you would do:
</p>
<p>
</p>
<div class="informalexample">
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td class="listing_lines" align="right"><pre>1</pre></td>
        <td class="listing_code"><pre class="programlisting"><span class="function">printf</span><span class="normal"> </span><span class="symbol">(</span><span class="string">"%c %s</span><span class="specialchar">\n</span><span class="string">"</span><span class="symbol">,</span><span class="normal"> direction</span><span class="symbol">,</span><span class="normal"> data</span><span class="symbol">);</span></pre></td>
      </tr>
    </tbody>
  </table>
</div>

<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>logger</code></em> :</span></p></td>
<td>the <a class="link" href="SoupLogger.html" title="SoupLogger"><span class="type">SoupLogger</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>level</code></em> :</span></p></td>
<td>the level of the information being printed.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>direction</code></em> :</span></p></td>
<td>a single-character prefix to <em class="parameter"><code>data</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>data to print</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>the data passed to <a class="link" href="SoupLogger.html#soup-logger-set-printer" title="soup_logger_set_printer ()"><code class="function">soup_logger_set_printer()</code></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="soup-logger-set-printer"></a><h3>soup_logger_set_printer ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                soup_logger_set_printer             (<em class="parameter"><code><a class="link" href="SoupLogger.html" title="SoupLogger"><span class="type">SoupLogger</span></a> *logger</code></em>,
                                                         <em class="parameter"><code><a class="link" href="SoupLogger.html#SoupLoggerPrinter" title="SoupLoggerPrinter ()"><span class="type">SoupLoggerPrinter</span></a> printer</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> printer_data</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> destroy</code></em>);</pre>
<p>
Sets up an alternate log printing routine, if you don't want
the log to go to <code class="literal">stdout</code>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>logger</code></em> :</span></p></td>
<td>a <a class="link" href="SoupLogger.html" title="SoupLogger"><span class="type">SoupLogger</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>printer</code></em> :</span></p></td>
<td>the callback for printing logging output</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>printer_data</code></em> :</span></p></td>
<td>data to pass to the callback</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>destroy</code></em> :</span></p></td>
<td>a <a href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> to free <em class="parameter"><code>printer_data</code></em>
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.18</div>
</body>
</html>